package com.ruoyi.item.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.item.mapper.SysGoodsAddrMapper;
import com.ruoyi.item.domain.SysGoodsAddr;
import com.ruoyi.item.service.ISysGoodsAddrService;

/**
 * 存放位置Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-25
 */
@Service
public class SysGoodsAddrServiceImpl implements ISysGoodsAddrService 
{
    @Autowired
    private SysGoodsAddrMapper sysGoodsAddrMapper;

    /**
     * 查询存放位置
     * 
     * @param deptId 存放位置主键
     * @return 存放位置
     */
    @Override
    public SysGoodsAddr selectSysGoodsAddrByDeptId(Long deptId)
    {
        return sysGoodsAddrMapper.selectSysGoodsAddrByDeptId(deptId);
    }

    /**
     * 查询存放位置列表
     * 
     * @param sysGoodsAddr 存放位置
     * @return 存放位置
     */
    @Override
    public List<SysGoodsAddr> selectSysGoodsAddrList(SysGoodsAddr sysGoodsAddr)
    {
        return sysGoodsAddrMapper.selectSysGoodsAddrList(sysGoodsAddr);
    }

    /**
     * 新增存放位置
     * 
     * @param sysGoodsAddr 存放位置
     * @return 结果
     */
    @Override
    public int insertSysGoodsAddr(SysGoodsAddr sysGoodsAddr)
    {
        sysGoodsAddr.setCreateTime(DateUtils.getNowDate());
        return sysGoodsAddrMapper.insertSysGoodsAddr(sysGoodsAddr);
    }

    /**
     * 修改存放位置
     * 
     * @param sysGoodsAddr 存放位置
     * @return 结果
     */
    @Override
    public int updateSysGoodsAddr(SysGoodsAddr sysGoodsAddr)
    {
        sysGoodsAddr.setUpdateTime(DateUtils.getNowDate());
        return sysGoodsAddrMapper.updateSysGoodsAddr(sysGoodsAddr);
    }

    /**
     * 批量删除存放位置
     * 
     * @param deptIds 需要删除的存放位置主键
     * @return 结果
     */
    @Override
    public int deleteSysGoodsAddrByDeptIds(Long[] deptIds)
    {
        return sysGoodsAddrMapper.deleteSysGoodsAddrByDeptIds(deptIds);
    }

    /**
     * 删除存放位置信息
     * 
     * @param deptId 存放位置主键
     * @return 结果
     */
    @Override
    public int deleteSysGoodsAddrByDeptId(Long deptId)
    {
        return sysGoodsAddrMapper.deleteSysGoodsAddrByDeptId(deptId);
    }
}
